package com.acme;

public class CheckingAccount extends Account {

	private double overdraft;
	private double balance;

	public CheckingAccount(final double balance, final double overdraft) {
		this.balance = balance;
		this.overdraft = overdraft;
	}

	public void withdraw(double amount) {
		// ========================
		assert (balance + overdraft) > 0 : "balance+overdraft is negative";
		// ========================
		if (amount <= (balance + overdraft)) {
			balance -= amount;
		} else {
			System.out.println("Error: withdraw failed");
		}
	};

}
